<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>constructor-selector</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/toast.style.css" rel="stylesheet">
    <style>
        html,
        body,
        ul {
            margin: 0;
            padding: 0;
        }
        
        ul {
            list-style: none;
            padding: 0 100px;
        }
        
        li {
            height: 50px;
            line-height: 50px;
            border-bottom: 1px solid #000;
            display: flex;
            justify-content: space-between;
        }
    </style>
</head>

<body>
    <h1>点击复制文本</h1>
    <h2>时间戳</h2>
    <ul class="time">
        
    </ul>
    <h2>ionic3开发</h2>
    <ul>
        <li><span>ionic serve</span>运行</li>
    </ul>
    <h2>ionic3打包</h2>
    <ul>
        <li><span>ionic cordova platform add android</span>添加平台</li>
        <li><span>ionic cordova build android</span>打包</li>
        <li><span>ionic cordova build android --prod</span>打包(快速启动)</li>
        <li><span> cordova plugin add cordova-plugin-file-transfer@1.6.3</span>安装指定版本</li>
        <li><span>cordova plugin add cordova-plugin-file@4.3.3</span>安装指定版本</li>
        <li><span>ionic cordova resources</span>添加图标</li>
        <li><span>cnpm install ws@3.3.2 --save-dev --save-exact</span>通讯错误</li>
    </ul>
    <h2>ionic3地址</h2>
    <ul>
        <li><span>https://gitee.com/MakerLi/ionic2MoBan.git</span>模版地址</li>
        <li><span>http://cc.ruiqinet.com/doc</span>后台地址</li>
    </ul>



    <script src="js/clipboard.min.js"></script>
    <script src="../../common/js/jquery.min.js"></script>
    <script src="js/toast.script.js"></script>


    <script>

        let timeStr=`<li><span>${(new Date()).valueOf()}</span>当前时间戳</li>`;
        $('.time').append(timeStr)
        $('li').click(function() {
            var text = $(this).find('span').text();
            $(this).attr('data-clipboard-text', text);
        })
        var clipboard = new Clipboard('li');

        clipboard.on('success', function(e) {
            console.log(e);
            addToast('复制成功！', '使用Ctrl+V粘贴', 'success');
        });

        clipboard.on('error', function(e) {
            addToast('复制失败！', '请检查代码', 'error');
        });

        function addToast(a, b, c) {
            // error
            // info
            // notice
            // success
            // warning
            $.Toast(a, b, c, {
                stack: true,
                has_icon: true,
                has_close_btn: true,
                fullscreen: false,
                timeout: 1000,
                sticky: false,
                has_progress: true,
                rtl: false,
            });
        }
    </script>
</body>

</html>